package com.jsb.laundry.common.enums;

import io.swagger.annotations.ApiModelProperty;

public enum BusinessType {
    order_paid("order_paid", "订单支付"),
    order_refund("order_refund", "订单退款"),
    order_paid_repair("order_paid_repair", "订单补差价支付"),
    order_refund_repair("order_refund_repair", "订单补差价退款"),
    gateway_fee("gateway_fee", "网关手续费"),
    rider_commission("rider_commission", "骑手分佣"),
    bonus("bonus", "奖金"),
    fine("fine", "罚款"),
    jxy_vip_paid("jxy_vip_paid", "聚洗衣小程序vip支付收款"),
    withdrawal("withdrawal", "提现"),
    withdrawal_fee("withdrawal_fee", "提现手续费"),
    user_recharge("user_recharge", "用户充值"),
    ;
    @ApiModelProperty("类型")
    private String businessType;
    @ApiModelProperty("名称")
    private String businessName;

    BusinessType(String businessType, String businessName) {
        this.businessType = businessType;
        this.businessName = businessName;
    }

    BusinessType() {
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getBusinessName() {
        return businessName;
    }

    public void setBusinessName(String businessName) {
        this.businessName = businessName;
    }
    /**
     * 根据type找枚举名
     *d
     * @param type
     * @return
     */
    public static String getNameById(String type) {
        for (BusinessType value : values()) {
            if (value.getBusinessType().equals(type)) {
                return value.getBusinessName();
            }
        }
        return null;
    }

}
